package com.wa.async;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Notes
 * @Author gary
 * @Date 2021/10/25 16:25
 **/
@Component
public class AsyncService {

    @Async("customExecutor")
    public void updateReadCount() {
        // TODO 模拟耗时操作
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("更新文章阅读量线程"+Thread.currentThread().getName());
    }
}
